package Fx;

public class ObjDemo {
    public static void main(String[] args) {

        Demo<String> demo = new Demo(); //相当于  public String getX()

        demo.setX("wubuze");

        String x = demo.getX();

        System.out.println("String 类型， 结果为："+x);
    }
}


//泛型类
class Demo<T> {
    private T x;

    public T getX() {
        return x;
    }

    public void setX(T x) {
        this.x = x;
    }
}
